package patterns.strategy;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: Feb 20, 2010
 * Time: 1:51:13 PM
 * To change this template use File | Settings | File Templates.
 */
interface S {
    public void go();
}

class A implements S {

    @Override
    public void go() {
//        System.out.println("1");
    }
}

class D implements S {

    @Override
    public void go() {
//        System.out.println("2");
    }
}

class C implements S {

    @Override
    public void go() {
//        System.out.println("3");
    }
}

class Context {
    private S strategy;

    Context(S strategy) {
        this.strategy = strategy;
    }

    public void ggo() {
        strategy.go();
    }

}
public class Strategy {


    public static void main(String[] args1) {
        Context j = new Context(new A());
        j.ggo();
    }
}
